package cz.zcu.fav.rat.dataaccess.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

public interface GenericDAO<T, PK extends Serializable>
{
	/** Persist the newInstance object into database */
//    @Transactional(readOnly = false)
	PK create(T newInstance);

	/**
	 * Retrieve an object that was previously persisted to the database using
	 * the indicated id as primary key
	 */
//    @Transactional(readOnly = true)
	T read(PK id);

	
	List<T> getAll();
	/** Save changes made to a persistent object. */
//    @Transactional(readOnly = false)
	void update(T transientObject);

	/** Remove an object from persistent storage in the database */
//    @Transactional(readOnly = false)
	void delete(T persistentObject);
    
	T merge(T persistentObject);

//    @Transactional(readOnly = false)
	public void saveOrUpdate(T persistentObject);
    
    
}
